﻿using Project.DAL.UsersInfoDal;
using Project.Model;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Project.BLL.UsersInfoBll
{
    public class UsersInfoBll : BaseBLL<user_info>
    {
        public override void SetDal()
        {
            Dal = new UsersInfoDal();
        }
        //登录
        public user_info LoginUsers(string UserName, string pwd,string activeTab,string mobile)
        {
            if (activeTab == "phone")
            {
                //手机号登录
                return base.Query().Where(x=>x.mobile== mobile).FirstOrDefault();
            }
            else {
                return base.Query().Where(x => x.username == UserName && x.password_hash == pwd).FirstOrDefault();
            }
          
        }

    }
}
